# Maintainer: David Runge <dvzrv@archlinux.org>

_name=BSEQuencer
_plugin_uri="https://www.jahnichen.de/plugins/lv2/BSEQuencer"
pkgname=bsequencer
pkgver=1.8.10
pkgrel=2
pkgdesc="Multi channel MIDI step sequencer LV2 plugin with a variable matrix"
arch=(loong64 x86_64)
url="https://github.com/sjaehn/BSEQuencer"
license=(GPL3)
groups=(
  lv2-plugins
  pro-audio
)
depends=(
  cairo
  gcc-libs
  glibc
  libx11
  lv2-host
)
makedepends=(lv2)
checkdepends=(lv2lint)
source=($url/archive/$pkgver/$_name-$pkgver.tar.gz)
sha512sums=('7157e28ff973d81ac9419b8178becf71f4e59c5415561592eccea2aa13eda3272da91dd089be85b817f8df724fd5008421e362d63fee3bda40e44d652b3cc9e5')
b2sums=('060277fae4cd4597cdfee1d3d586017b4eed60e06e24f7c98259758e170770a4354c47cc2d53fa001ac1c5739b55de92d667c50a08521582a930684a9bce0c90')

build() {
  make -C $_name-$pkgver
}

check() {
  # UI symbols likely exposed because of broken upstream or LTO
  lv2lint -Mpack -t "UI Symbols" -I $_name-$pkgver/$_name.lv2/ "$_plugin_uri"
}

package() {
  make PREFIX=/usr DESTDIR="$pkgdir/" install -C $_name-$pkgver
  install -vDm 644 $_name-$pkgver/README.md -t "$pkgdir/usr/share/doc/$pkgname/"
  # remove useless license file
  find "$pkgdir/usr/lib/" -type f -iname "*LICENSE*" -delete
}
